<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>八卦图</title>
    <style>
        body {
            background: #eee;
        }
        *{
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        @keyframes x {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        #八卦 {
            width: 400px;
            height: 400px;
            border-radius: 50%; 
            /*给200正好是50%，如果给400的一半要大（如：300px），那么也会显示一个正圆*/
            position: relative; /* 超出隐藏 */
            overflow: hidden; 
            animation: x 10s infinite linear; 
            box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.75)
        }

        #八卦>div:first-child {
            width: 50%;
            height: 100%;
            position: absolute;
            left: 0;
            background: black;
            
        }

        #八卦>div:nth-child(2) {
            width: 50%;
            position: absolute;
            right: 0;
            height: 100%;
            background: white;
        }

        #八卦>div:nth-child(3){
            position: absolute;
            width: 200px;
            height: 200px;
            left: 50%;
            margin-left: -100px;
            border-radius: 50%;
            background: black;
        }

        #八卦>div:nth-child(4) {
            position: absolute;
            width: 200px;
            height: 200px;
            left: 50%;
            bottom: 0;
            margin-left: -100px;
            border-radius: 50%;
            background: white;
        }

        #八卦>div:nth-child(5) {
            position: absolute;
            width: 50px;
            height: 50px;
            left: 50%;
            top: 75px;
            margin-left: -25px;
            border-radius: 50%;
            background: white;
        }

        #八卦>div:nth-child(6) {
            position: absolute;
            width: 50px;
            height: 50px;
            left: 50%;
            bottom: 75px;
            margin-left: -25px;
            border-radius: 50%;
            background: black;
        }

        #八卦-wrapper {
            height: 100vh;
            /* vh: viewpoint height */
            /* flex三件套：display, justify-content, align-items */
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }
        #八卦-描述 {
            margin-top: 1em;
        }
    </style>
</head>
<body>
    <div id="八卦-wrapper">
        <div id = "八卦">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div> 
        <div id="八卦-描述">道可道，非常道</div>
    </div>
</body>
</html>